﻿using System;
using System.Collections.Generic;
using Tasks247.Data;
using Tasks247.Model;

namespace Tasks247.Views
{
    public class TasksView
    {
        public TasksView(ITasksRepository repository)
        {
            List<TaskEntity> tasks = repository.Read();
            Console.WriteLine("{0},{1}", "Id".PadLeft(10), "Name".PadLeft(20));
            foreach (TaskEntity task in tasks)
            {
                Console.WriteLine("{0},{1}", task.Id.ToString().PadLeft(10), task.Name.PadLeft(20));
                Console.WriteLine("Notes: {0}", task.Notes.PadLeft(30));
            }
        }
    }
}
